<?php
namespace app\admin\validate;

use think\Validate;

class BrandValidate extends Validate
{
    protected $rule =   [
        'brand_name'  => 'require|unique:brand',
        'brand_url'   => 'url',
        'brand_description' => 'min:6',    
    ];
    
    protected $message  =   [
        'brand_name.require' => '品牌名称必须填写',
        'brand_name.upique'     => '品牌名称不能重复',
        'brand_url.url'   => '网址格式不正确',
        'brand_description.min'  => '描述最少6个字',    
    ];
    // 验证场景
    protected $scene = [
        'add'   =>  ['brand_name','brand_url'],
        'edit'  =>  ['brand_name'],
    ];
    
}